package com.esunny.resourcevisualization.proxy;

import org.apache.logging.log4j.util.PropertiesUtil;

/**
 * 禅道操作相关常量类
 *
 * @author xiaodizi
 */
public class Constant {

    static PropertiesUtil applicationProperties;

    static PropertiesUtil applicationDevelopProperties;

    static {
        /*
          application.properties文件名
         */
        final String propertiesFileName = "application.properties";
        applicationProperties = new PropertiesUtil(propertiesFileName);

        final String devPropertiesFileName = "application-dev.properties";
        applicationDevelopProperties = new PropertiesUtil(devPropertiesFileName);
    }

    /*====常量声明区====*/


    /**
     * http请求成功状态码，200
     */
    public static final int HTTP_SUCCESS_CODE = 200;

    /**
     * 禅道处理请求状态字符串
     */
    public static final String ZENTAO_SUCCESS = "success";

    /**
     * 禅道应用返回接口中标识状态的字段
     */
    public static final String ZENTAO_STATUS_NODE = "status";

    /**
     * 禅道应用返回接口中数据的字段
     */
    public static final String ZENTAO_DATA_NODE = "data";

    /**
     * 禅道应用登录返回接口中用户的字段
     */
    public static final String ZENTAO_USER_NODE = "user";

    /**
     * 禅道地址
     */
    public static final String ZENTAO_ADDRESS = applicationDevelopProperties.getStringProperty("zentao.address");

    /**
     * 禅道应用ID
     */
    public static final String ZENTAO_APP_CODE = applicationProperties.getStringProperty("zentao.appName");

    /**
     * 禅道应用Key
     */
    public static final String ZENTAO_APP_KEY = applicationProperties.getStringProperty("zentao.appKey");

    /**
     * 用户名字符串常量
     */
    public static final String ZENTAO_USERNAME = "account";

    /**
     * 密码字符串常量
     */
    public static final String ZENTAO_PASSWORD = "password";

    /*====常量声明区====*/

}
